<template>
	<view>
		<view class="box">
			<view class="top">
				<u-icon name="rmb-circle" color="#FFAB00" size="30"></u-icon>
				<text style="margin-left:10rpx ;">我的收款码</text>
			</view>
			<view class="mabox">
				<view>
					<tki-qrcode v-if="ifShow" cid="qrcode1" ref="qrcode" :val="val" :size="size" :unit="unit" :background="background"
					 :foreground="foreground" :pdground="pdground" :icon="icon" :iconSize="iconsize" :lv="lv" :onval="onval" :loadMake="loadMake"
					 :usingComponents="true" />
				</view>
			</view>
		</view>
		<!-- <canvas canvas-id="qrcode" v-if ="url == '' " style="opacity: 1;"></canvas> -->
	</view>
</template>

<script>
	import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
	export default {
		components: {
			tkiQrcode
		},
		data() {
			return {
				url: "",
				ifShow: true,
				val: '', // 要生成的二维码值
				size: 300, // 二维码大小
				unit: 'upx', // 单位
				background: '#ffffff', // 背景色
				foreground: '#333333', // 前景色
				pdground: '#333333', // 角标色
				icon: '', // 二维码图标
				iconsize: 170, // 二维码图标大小
				lv: 3, // 二维码容错级别 ， 一般不用设置，默认就行
				onval: false, // val值变化时自动重新生成二维码
				loadMake: true, // 组件加载完成后自动生成二维码
				src: '', // 二维码生成后的图片地址或base64
				recommendCode: ''
			}
		},
		onLoad(e) {
			let phone=uni.getStorageSync("userInfo").account
			this.val = "http://laibaapp.bxwhl.com/#/pages/tong/transferanother?phone="+phone
			// this.recommendCode = e.ma
		},
		methods: {
			navback() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style>
	.mabox{
		display: flex;
		justify-content: center;
		padding: 80rpx 0;
	}
	.top{
		height: 66rpx;
		background: #EBEBEB;
		display: flex;
		align-items: center;
		opacity: 1;
		padding-left: 10rpx;
		color: #FFAB00;
		font-size: 28rpx;
	}
	.box{
		width: 690rpx;
		border-radius: 20rpx;
		overflow: hidden;
		margin: 100rpx 30rpx;
		background-color: #FFFFFF;
	}
	page {
		background-color: #06923D;
	}
</style>
